﻿/*
#------------------------------------------------------------------------------
#-- Program Name:	[dbo].[tblWH_Log]
#-- Purpose:		Store the warehouse copy of maintenance log activity
#--	Last Update:	03/21/2013
#--					For a complete history - please review comments in Version
#--					Control.
#------------------------------------------------------------------------------
*/
CREATE TABLE [dbo].[tblWH_Log]
(
	mnt_id int NOT NULL IDENTITY(1, 1),
	[mnt_server_ssd_id] int NOT NULL,
	mnt_table_catalog nvarchar(128) NULL,
	mnt_table_schema nvarchar(128) NULL,
	mnt_table_name nvarchar(128) NULL,
	mnt_action_date datetime NOT NULL,
	mnt_action_type nvarchar(128) NOT NULL,
	mnt_success bit NOT NULL,
	mnt_results ntext NULL, 
	CONSTRAINT [PK_tblWH_Log] PRIMARY KEY ([mnt_id]),
	CONSTRAINT [FK_tblWH_Log_tblMSX_server_discovery] FOREIGN KEY ([mnt_server_ssd_id]) REFERENCES [tblMSX_server_discovery] ([ssd_id])
)
GO
CREATE NONCLUSTERED INDEX [IX_tblWH_Log_ServerDateType] ON [dbo].[tblWH_Log]
(
	[mnt_server_ssd_id] ASC,
	[mnt_action_date] ASC,
	[mnt_action_type] ASC
)
GO
